<?php

namespace app\common\model\repertory;

use app\common\model\BaseModel;
use app\common\model\repertory\Dept;

/**
 * 用户
 */
class User extends BaseModel
{
    protected $name = 'repertory_user';
    protected $pk = 'id';

    public static function detail($id)
    {
        return self::find($id);
    }

    public function depts()
    {
        return $this->belongsTo(Dept::class, 'dept_id', 'id')->bind(['dept_title' => 'title']);
    }
}
